package com.qpx.jxcauth.web;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.qpx.jxcauth.service.ITUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 *
 *
 *
 *
 * 创建时间
 *
 * @author Mht
 * @since 2020-05-20
 */
@RestController
@RequestMapping("/tUser")
@Slf4j
public class TUserController {

    @Autowired
    ITUserService itUserService;

    @RequestMapping("/test")
    public Object test() {
        Wrapper wrapper = new EntityWrapper();
        List list = itUserService.selectList(wrapper);
        return list;
    }

    @GetMapping("/user/info")
    public Principal user(Principal member) {
        log.info("当前登录人的信息为:{}", JSON.toJSONString(member));
        return member;
    }


}
